package ex20;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) throws IOException {
		
		InputStreamReader it = new InputStreamReader(System.in);
		BufferedReader in = new BufferedReader(it);
		
		int ageDays, year, month, day;
		
		ageDays = Integer.parseInt(in.readLine());
		
		year = ageDays / 365;
		month = (ageDays - (year * 365)) / 30;
		day = (ageDays - (year * 365)) % 30;
		
		System.out.printf("%d ano(s)\n", year);
		System.out.printf("%d mes(es)\n", month);
		System.out.printf("%d dia(s)\n", day);
		
	}

}
